package net.designbased.jspfire;

import com.thoughtworks.xstream.annotations.*;
import java.util.ArrayList;
import java.util.List;

/**
 * 数据序列
 * @author chenhongliang
 */
@XStreamAlias("vc:DataSeries")
public class DataSeries {
    @XStreamAlias("ZIndex")
    @XStreamAsAttribute
    private int zindex = 0;

    @XStreamAlias("Bevel")
    @XStreamAsAttribute
    private boolean bevel = false;

    @XStreamAlias("ShowInLegend")
    @XStreamAsAttribute
    private boolean showInLegend = true;

    @XStreamAlias("Legend")
    @XStreamAsAttribute
    private String legend;

    @XStreamAlias("LegendText")
    @XStreamAsAttribute
    private String legendText;

    @XStreamAlias("AxisYType")
    @XStreamAsAttribute
    private AxisType axisYType = AxisType.Primary;

    @XStreamAlias("vc:DataSeries.DataPoints")
    private List<DataPoint> dataPoints = new ArrayList<DataPoint>();

    @XStreamAlias("RenderAs")
    @XStreamAsAttribute
    private ChartType renderAs = ChartType.Column;

    /**
     * Z轴的值
     * @return
     */
    public int getZIndex(){
        return this.zindex;
    }

    /**
     * 设置Z轴的值
     * @param zindex
     */
    public void setZIndex(int zindex){
        this.zindex = zindex;
    }

    /**
     * 是否显示斜角
     * @return
     */
    public boolean isBevle(){
        return this.bevel;
    }

    /**
     * 设置是否显示斜角
     * @param bevel
     */
    public void setBevel(boolean bevel){
        this.bevel = bevel;
    }

    /**
     * 是否在图例中显示
     * @return
     */
    public boolean isShowInLegend(){
        return this.showInLegend;
    }

    /**
     * 设置是否在图例中显示
     * @param showInLegend
     */
    public void setShowInLegend(boolean showInLegend){
        this.showInLegend = showInLegend;
    }

    /**
     * 图例名称
     * @return
     */
    public String getLegend(){
        return this.legend;
    }

    /**
     * 设置图例名称
     * @param legend
     */
    public void setLegend(String legend){
        this.legend = legend;
    }

    /**
     * 图例文本
     * @return
     */
    public String getLegendText(){
        return this.legendText;
    }

    /**
     * 设置图例文本
     * @param legendText
     */
    public void setLegendText(String legendText){
        this.legendText = legendText;
    }

    /**
     * Y轴的类型，默认为Primary
     * @return
     */
    public AxisType getAxisYType(){
        return this.axisYType;
    }

    /**
     * 设置Y轴的类型
     * @param axisYType
     */
    public void setAxisYType(AxisType axisYType){
        this.axisYType = axisYType;
    }

    /**
     * 显示图表类型
     * @return
     */
    public ChartType getRenderAs(){
        return this.renderAs;
    }

    /**
     * 设置显示的图表类型
     * @param renderAs
     */
    public void setRenderAs(ChartType renderAs){
        this.renderAs = renderAs;
    }

    /**
     * 添加一个数据结点
     * @param dataPoint
     */
    public void AddDataPoint(DataPoint dataPoint){
        this.dataPoints.add(dataPoint);
    }

    /**
     * 移除一个数据结点
     * @param dataPoint
     */
    public void removeDataPoint(DataPoint dataPoint){
        this.dataPoints.remove(dataPoint);
    }
}
